#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
'''
@author: yuejl
@application:
@contact: lewyuejian@163.com
@file: takes.py
@time: 2021/8/22 0022 20:23
@desc:
'''
def use_mapping(name):
    """根据key获取函数返回结果为字典的值"""
    def decorator(func):
        def wrapper(*args, **kwargs):
            result = func(*args, **kwargs)
            extract_res = result.get(name)
            return extract_res
        return wrapper
    return decorator